home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 046_060 / 050c / Text
Encoding:
Text File  |  1993-08-02  |  30.0 KB  |  957 lines

  1. 6th August 1992
  2. -----------------------------------------------------------------------------
  3. Support Group Application Note 
  4. Number: 050
  5. Issue: 1 
  6. Author:
  7. -----------------------------------------------------------------------------
  8.  
  9. Master 512: Technical Information and Monitor Documentation
  10.  
  11. -----------------------------------------------------------------------------
  12. Applicable Hardware: BBC Master 512
  13.  
  14. Related Application Notes:
  15.  
  16.  
  17. -----------------------------------------------------------------------------
  18. Copyright (C) Acorn Computers Limited 1992
  19.  
  20. Every effort has been made to ensure that the information in this leaflet is 
  21. true and correct at the time of printing. However, the products described in
  22. this leaflet are subject to continuous development and improvements and
  23. Acorn Computers Limited reserves the right to change its specifications at
  24. any time. Acorn Computers Limited cannot accept liability for any loss or
  25. damage arising from the use of any information or particulars in this
  26. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  27. Limited.
  28. -----------------------------------------------------------------------------
  29. Support Group
  30. Acorn Computers Limited
  31. Acorn House
  32. Vision Park
  33. Histon
  34. Cambridge       CB4 4AE
  35. -----------------------------------------------------------------------------
  36.  
  37.  
  38. Introduction
  39.  
  40. The information contained in this application note is designed to allow
  41. a programmer using the Master  512  to access the standard MOS calls of
  42. the Master 128 using the software interrupts  provided.  It details the
  43. calls, error trapping, etc which are necessary to write  a program that
  44. is either to run under DOS+, or as a stand  alone  application in place
  45. of DOS+.
  46.  
  47. Operating System calls
  48.  
  49. Some of the operating system  calls  of  the Master 128 may be accessed
  50. from  the  80186 co-processor by using the 80186  software  interrupts.
  51. There  are 256  software  interrupts  supported  and  each  one  has  a
  52. corresponding 4 byte vector in the first 1 kbyte of the 80186 memory.
  53.  
  54. Interrupts 040H to 04CH are  reserved for the 13 MOS calls supported on
  55. the co-processor. All the operating system calls take parameters in the
  56. 80186 registers AL,BH and BL. corresponding  to  the 6502 registers A,X
  57. and Y. The operating system calls are explained below:
  58.  
  59. Summary of Master 128 MOS calls 
  60.  
  61. Routine          Interrupt       Address         Function
  62.                      
  63. OSFIND           040H            0100H           OPEN OR CLOSE A FILE
  64. OSGBPB           041H            0104H           MULTIPLE PUT/GET BYTES
  65. OSBPUT           042H            0108H           WRITE A SINGLE BYTE TO A FILE 
  66. OSBGET           043H            010CH           READ A SINGLE BYTE FROM A FILE 
  67. OSARGS           044H            0110H           LOAD/SAVE FILE PARAMETERS 
  68. OSFILE           045H            0114H           LOAD/SAVE A COMPLETE FILE 
  69. OSRDCH           046H            0118H           READ CHARACTER FROM INPUT STREAM 
  70. OSASCI           047H            011CH           WRITE CHAR TO OUTPUT STRM (&D GIVES CR & LF) 
  71. OSNEWL           048H            0120H           WRITE CR & LF TO SCREEN
  72. OSWRCH           049H            0124H           WRITE CHARACTER TO OUTPUT STREAM 
  73. OSWORD           O4AH            0128H           VARIOUS MULTI-BYTE CALLS
  74. OSBYTE           04BH            012CH           VARIOUS SINGLE BYTE CALLS 
  75. OSCLI            04CH            0130H           INTERPRET COMMAND LINE
  76.  
  77. NOTE - The Master  128  MOS  calls OSRDSC, OSWRSC, OSEVEN, GSINIT and
  78. GSREAD  are  not  supported by the 80186 but  OSWORD  with  AL  =  0FAH
  79. provides the functions of OSRDSC and OSWRSC.
  80.  
  81. OSRDSC           OSWORD AL=0FAH          READ BYTE FROM SCREEN OR PAGED ROM 
  82. OSWRSC           OSWORD AL=0FAH          WRITE BYTE TO SCREEN OR PAGED ROM 
  83.  
  84.  
  85. Description of Master 128 MOS calls
  86.  
  87. OSFIND
  88.  
  89. Open a file for reading and writing.
  90.  
  91. On entry:-
  92.  
  93. AL specifies the operation.
  94.  
  95. AL = 0   File is to be closed
  96. AL = 40H File to be opened for input only
  97. AL = 80H File to be opened for output only
  98. AL = C0H File to be opened for random access
  99.  
  100. DS:BX contain a pointer to the filename
  101.  
  102. Filename must be terminated by carriage return (&0D)
  103.  
  104. On exit
  105.  
  106. AL contains the file handle  or  0 if file has been closed or could not
  107. be opened.
  108.  
  109. Flags:   undefined
  110.  
  111.  
  112. OSGBPB
  113.  
  114. Read/write a block of bytes from/to a specified open file.
  115.  
  116. On entry:-
  117.  
  118. AL specifies operation type from the following:
  119.  
  120. AL = 1           Put bytes to media using sequential pointer
  121. AL = 2           Put bytes to media ignoring sequential pointer
  122. AL = 3           Get bytes from media using sequential pointer
  123. AL = 4           Get bytes from media ignoring sequential pointer
  124. AL = 5           Get media title and boot option
  125. AL = 6           Read currently selected directory and device
  126. AL = 7           Read currently selected library and device
  127. AL = 8           read filenames from currently selected directory
  128.  
  129. DS:BX point to a control block in the form:-
  130.  
  131. 00       File handle
  132. 01       Pointer to data in either I/O processor or tube processor (low byte first) 
  133. 02
  134. 03
  135. 04
  136. 05       Number of bytes to be transferred (low byte first)
  137. 06
  138. 07
  139. 08
  140. 09       Pointer value to be used for transfer (low byte first)
  141. 0A      
  142. 0B
  143. 0C
  144.  
  145. On exit
  146.  
  147. AL contains a return value where:
  148.  
  149. AL = 0                   Operation attempted
  150. AL = entry value         Call not supported in this filing system
  151.  
  152. Flags:
  153.  
  154. CF = reset       Transfer completed
  155. CF = set         End of file reached before transfer complete
  156.  
  157. OSBPUT
  158.  
  159. Write a single byte to  a  specified open file at the point in the file
  160. designated by the sequential pointer.
  161.  
  162. On entry
  163.  
  164. AL contains the byte to be written
  165. BH contains the file handle (provided by OSFIND)
  166.  
  167. On exit
  168.  
  169. No exit values
  170.  
  171. Flags:   undefined
  172.  
  173.  
  174. OSBGET
  175.  
  176. Read a single byte from  a specified open file at the point in the file
  177. designated by the sequential pointer.
  178.  
  179. On entry
  180.  
  181. BH contains the file handle (provided by OSFIND)
  182.  
  183. On exit
  184.  
  185. AL contains the byte read from the file
  186.  
  187. Flags:
  188.  
  189. CF is set if an attempt is made to read past the end of the file
  190.  
  191. OSARGS
  192.  
  193. Load/save file parameters to/from the specified open file
  194.  
  195. On entry
  196.  
  197. AL contains the operation type (see below)
  198. AH contains the file handle (provided by OSFIND) or 0
  199. BX points to a 4 byte attribute block
  200.  
  201. If AH = 0
  202.  
  203. AL = 0   Returns the current filing system in AL
  204. AL = 1   Returns the address of the rest of the command line in the base page control block 
  205. AL = &FF Update all files onto the media (make sure memory buffer saved)
  206.  
  207. If AH <= 1
  208.  
  209. AL = 0   Read sequential pointer of file
  210. AL = 1   Write sequential pointer of file
  211. AL = 2   Read length of file
  212.  
  213. On exit
  214.  
  215. AL contains the filing system number when entered with AL = 0, AH = 0
  216.  
  217. AL = 0   No filing system
  218. AL = 1   1200 baud cassette
  219. AL = 2   300 baud cassette
  220. AL = 3   ROM FS
  221. AL = 4   DFS
  222. AL = 5   ANFS/NFS
  223. AL = 6   TFS
  224. AL = 8   ADFS
  225.  
  226. Note  1:  The  control block always remains in the I/O processor memory
  227. not the 80186 processor memory.
  228.  
  229. Note 2: If AL=1 and  AH=0 on entry, the address of the remainder of the
  230. last command line is returned in a four byte zero page block pointed to
  231. by BX. This address always points  to  the  I/O  processor  and  should
  232. therefore  be  read using OSWORD 5. The text making up the remainder of
  233. the  last  command  line  always  terminates  with  a  carriage  return
  234. character (13H).
  235.  
  236.  
  237. OSFILE
  238.  
  239. Read/Write a complete file or catalogue information
  240.  
  241. On entry
  242.  
  243. AL       Contains the operation type:-
  244.  
  245. AL = 0   Save a block of memory as a file
  246. AL = 1   Write the information in the parameter block to the catalogue for an existing file 
  247. AL = 2   Write the load address for an existing file
  248. AL = 3   Write the execution address for an existing file
  249. AL = 4   Write the attributes for an existing files
  250. AL = 5   Read a files catalogue info with the file type returned in AL and the info returned in the parameter block 
  251. AL = 6   Delete the named file
  252. AL = &FF Load the named file
  253.  
  254. DS:BX    Point to a control block in the form:
  255.  
  256. 00       Address of filename terminated by CR (&0D)
  257. 01
  258. 02       Load address of file (low byte first)
  259. 03
  260. 04
  261. 05
  262. 06       Execution address (low byte first)
  263. 07
  264. 08
  265. 09
  266. 0A       Start address of data for save (low byte first)
  267. 0B
  268. 0C
  269. 0D
  270. 0E       End address of data for save (low byte first)
  271. 0F       or File attributes (see below)
  272. 10
  273. 11
  274.  
  275. The file attributes  are  stored  in  four bytes the most significant 3
  276. bytes are filing system specific. The LSB  has  the following meanings,
  277. where the relavent bit is set:
  278.  
  279. 0        No read access to owner (i.e. filename /WR)
  280. 1        No write access to owner (i.e. filename LR/)
  281. 2        Not executable by owner (i.e. filename /)
  282. 3        Not deletable by owner (i.e. filename L)
  283. 4        No public read access
  284. 5        No public write access
  285. 6        Not executable with public access
  286. 7        Not deletable with public access
  287.  
  288. On exit
  289.  
  290. AL contains the file type:
  291.  
  292. AL = 0   File not found
  293. AL = 1   File found
  294. AL = 2   Directory found
  295. AL = &FF Protected file
  296.  
  297. Flags: undefined
  298.  
  299.  
  300. OSRDCH
  301.  
  302. Read a character from the currently selected input stream
  303.  
  304. On entry
  305.  
  306. No entry parameters
  307.  
  308. On exit
  309.  
  310. AL contains the character or an error code
  311.  
  312. Flags:
  313.  
  314. CF = reset       Valid character read
  315. CF = set         Error condition (value in AL)
  316.  
  317. OSWRCH
  318.  
  319. Write a character to the currently selected output stream
  320.  
  321. On entry
  322.  
  323. AL contains the character to be written
  324.  
  325. On exit
  326.  
  327. No exit parameters
  328.  
  329. Flags: undefined
  330.  
  331. OSASCI
  332.  
  333. Write a character to the  currently selected output stream, but do a CR
  334. and LF if character is CR (&0D)
  335.  
  336. On entry
  337.  
  338. AL contains the character to be written
  339.  
  340. On exit
  341.  
  342. No exit parameter
  343.  
  344. Flags: Undefined
  345.  
  346. OSNEWL
  347.  
  348. Write CR and LF to currently selected output stream
  349.  
  350. On entry
  351.  
  352. No entry parameters
  353.  
  354. On exit
  355.  
  356. No exit parameters
  357.  
  358. Flags: undefined
  359.  
  360.  
  361. OSWORD
  362.  
  363. Various functions using a control block
  364.  
  365. On entry
  366.  
  367. AL contains the OSWORD type  (see  list  of  OSWORD calls in the Master
  368. reference manual part 1)
  369.  
  370. DS:BX  point to the control  block  which is call dependent (see Master
  371. reference manual part 1)
  372.  
  373. On exit
  374.  
  375. Parameters returned in control block are call dependent
  376.  
  377. Flags: undefined
  378.  
  379. OSBYTE
  380.  
  381. Various functions using registers
  382.  
  383. On entry
  384.  
  385. AL contains the OSBYTE type (see list of OSBYTE/*FX calls in the Master
  386. reference manual part 1)
  387. BL first OSBYTE parameter
  388. BH second OSBYTE parameter (if needed)
  389.  
  390. On exit
  391.  
  392. BL contains the first return  parameter  BH  contains the second return
  393. parameter
  394.  
  395. Flags:
  396.  
  397. CF value is call dependent
  398.  
  399. OSCLI
  400.  
  401. Send  a  string to the  command  line  interpreter  which  decodes  and
  402. executes any recognised command
  403.  
  404. On entry
  405.  
  406. DS:BX point to the string
  407.  
  408. On exit
  409.  
  410. No exit parameters
  411.  
  412. Flags: undefined
  413.  
  414. For  example  setting up DS:BX to point  to  the  string  "cat",  would
  415. produce a catalogue of the currently selected filing system directory.
  416.  
  417. Note: With this form of using OSCLI, you cannot pass variables with the
  418. string as you can from  withing  BBC  BASIC  on the 65C12. Unrecognised
  419. commands  will produce an error, which will be reported  by  the  80186
  420. error routine, unless trapped.
  421.  
  422. Commands that  can  be  passed  to  the  command line, are the star (*)
  423. commands that are listed in response to a  *help  (OSCLI"help") command
  424. or *help application (OSCLI"help application"). i.e.
  425.  
  426. oscli    equ     04ch
  427. cr       equ     13
  428.  
  429.          xor     al,al   ;clear al
  430.          mov     bx,offset my_string
  431.          int     oscli
  432. my_string:
  433.          ds      "help mos"
  434.          db      cr
  435.  
  436. Note that the string must be terminated with a Carriage return (13).
  437.  
  438.  
  439. Block data transfer on the 80186
  440.  
  441. The 80186 ROM  implements  an  additional OSWORD call with AL = 0FAH to
  442. allow  efficient  transfer  of  blocks  of   data   between   the 80186
  443. processor and the host 65C12  processor.  This  OSWORD  call is used by
  444. setting  up  the following control block which must be  pointed  to  by
  445. DS:BX. The format of the control block is:
  446.  
  447. 0        Number of parameters sent to I/O processor (0DH or 0EH)
  448. 1        Number of parameters read from I/O processor (01H)
  449. 2        LSB of I/O processor address
  450. 3
  451. 4
  452. 5        MSB of I/O processor address
  453. 6        LSB of 80186 offset address
  454. 7        MSB of 80186 offset address
  455. 8        LSB of 80186 segment address
  456. 9        MSB of 80186 segment address
  457. A        LSB of length of transfer
  458. B        MSB of length of transfer
  459. C        Operation type (see below)
  460. D        65C12 memory access control
  461.  
  462. The operation type specifies the type of transfer as follows:
  463.  
  464. 0        Write to 65C12 at 24 us/byte
  465. 1        Read from 65C12 at 24 us/byte
  466. 2        Write to 65C12 at 26 us/pair of bytes
  467. 3        Read from 65C12 at 26 us/pair of bytes
  468. 6        Write to 65C12 at 10 us/byte using 256 byte blocks
  469. 7        Read from 65C12 at 10 us/byte using 256 byte blocks
  470.  
  471. The memory access  control  byte allows access to the paged ROMS, paged
  472. RAM and shadow RAM in the host machine and is laid out as follows:
  473.  
  474. 7        6       5       4       3       2       1       0
  475. x        sm      m/s     c       pr3     pr2     pr1     pr0
  476.  
  477. Where the bits have the following functions.
  478.  
  479. x        Unused
  480. sm       If 3000H <= I/O address < 8000H sm=1 use screen memory
  481.          regardless of state of *shadow - overrides bit 5
  482. m/s      0 Use main screen memory if screen address specified
  483.          1 Use shadow screen memory if screen address specified
  484. c        If 8000H <= I/O address  <  C000H  If  c=0  use  specified ROM
  485.          number, if c=1 use currently selected ROM
  486. pr3-pr0  Paged ROM number
  487.  
  488. The memory access byte is  only  used  if the first byte of the control
  489. block is set to 0EH it is otherwise  ignored.  Use of the memory access
  490. byte  allows  paged ROM software to be copied and therefore  should  be
  491. restricted to system  use.  This  however  would  prevent access to the
  492. shadow  RAM  which is not used by the  system  and  cannot  be  legally
  493. accessed by other means.
  494.  
  495. A small example of the call is now given. This assumes that the control
  496. block has been setup correctly and is located in the first 64k segment.
  497. A contiguous 36 Kbyte area of memory is being used as a buffer for data
  498. written  from  2000:1000  in the 80186. The host buffer starts at 3000H
  499. and extends to BFFFH.  3000H  to  7FFFH  is  specified as shadow screen
  500. memory and 8000H to BFFFH is specified as paged RAM in bank 5.
  501.  
  502. osword   equ     04ah
  503. transfer equ     0fah
  504.  
  505.          sub     ax,ax   ;points ds:bx at control block
  506.          mov     ds,ax
  507.          mov     bx,offset transfer_block
  508.          mov     al,transfer     ;set up osword type
  509.          int     osword
  510.  
  511. transfer_block:
  512.          db      0eh
  513.          db      01h
  514.          dw      3000h,0         ;base address in 65C12
  515.          dw      1000h,2000h     ;base address in 80186
  516.          dw      9000h           ;length = 36K
  517.          db      6               ;fast 256 byte blocks
  518.          db      025h            ;use shadow and paged RAM
  519.  
  520.  
  521. Error handling by the 80186 monitor
  522.  
  523. When an error is generated  by  the host processor the error number and
  524. string are passed across the Tube to  the  80186  under  interrupt. The
  525. error  number  and  string are then placed in the error buffer  of  the
  526. 80186 and a pointer  is  initialized  to point to the error number. The
  527. error string is terminated by  a  null  byte (00H). The 80186 Tube code
  528. then  jumps  to the error handler, this prints  out  the  error  before
  529. returning control to the 80186 monitor.
  530.  
  531. The  locations  of the error handler vector and error pointer are given
  532. below:
  533.  
  534. 0000:05F4        Error pointer offset
  535. 0000:05F6        Error pointer segment
  536.  
  537. 0000:05F8        Error handler vector offset
  538. 0000:05FA        Error handler vector segment
  539.  
  540. Error handling by stand alone applications
  541.  
  542. The error handling  provided  by  the 80186 monitor is not suitable for
  543. stand alone languages, that is languages  which  only use MOS functions
  544. and the host machines filing systems, not the DOS+ operating system; as
  545. control is returned to the monitor by the  default  error handler. When
  546. the  language  is  started  up  it  should initialise the error handler
  547. vector to point to its own error  handler, which should then be able to
  548. deal  with the error in an appropriate way  and  return  control  to  a
  549. suitable point within the language.
  550.  
  551. An example  is  now  given  to illustrate a typical error handler. This
  552. assumes  that the language is running  at  0000:8000.  The  example  is
  553. written using the Digital Research RASM86 assembler format.
  554.  
  555. cseg     0
  556. org      08000h
  557.  
  558. osnewl   equ     048h
  559. oswrch   equ     049h
  560.  
  561. error_pointer_offset     equ     .05f4h
  562. error_pointer_segment    equ     .05f6h
  563.  
  564. error_handler_offset     equ     .05f8h
  565. error_handler_segment    equ     .05fah
  566.  
  567. ; initialise error handler to point to my error handler
  568.  
  569.          sub     ax,ax
  570.          mov     ds,ax
  571.          mov     ax,offset my_error_handler
  572.          mov     error_handler_offset,ax
  573.          mov     ax,seg my_error_handler
  574.          mov     error_handler_segment,ax
  575.  
  576. my_error_handler:
  577.          lds     si,dword ptr error_pointer_offset
  578.          int     osnewl  ;new line
  579.          inc     si              ;skip error number
  580.          cld                     ;set forward direction
  581.  
  582. my_error_loop:
  583.          lodsb                   ;get error string from buffer
  584.          int     oswrch          ;and write it out
  585.          test    al,al           ;end of string?
  586.          jnz     my_error_loop   ;no - get next character
  587.          jmp     my command_loop ;yes - jump to command loop
  588.  
  589.  
  590. 80186 Error Messages
  591.  
  592. Errors can  also  be  generated  by  the 80186 using interrupt 04FH and
  593. following it with the error number and  the  error  string,  terminated
  594. with  a  null  byte (00H). The error pointer will be initialised as for
  595. 65C12 errors and the  same  error  handler will be used as given by the
  596. error handler vector.
  597.  
  598. An example is given below to illustrate the use of 80186 errors. In the
  599. following example a test is being made  for  the  presence  of  a  file
  600. before attempting to load it. The example assumes that the file name is
  601. in the current data segment.
  602.  
  603. ; set up parameters
  604.  
  605. error    equ     04fh    ; the error interrupt number
  606. osfind   equ     040h
  607.  
  608. open_for_input           equ     040h
  609. not_found_error  equ     06dh
  610. cr       equ     13
  611.  
  612. cseg
  613.  
  614. look_for_file:
  615.          mov     al,open_for_input
  616.          mov     bx,offset my_file_name
  617.          int     osfind
  618.          or      al,al
  619.          jnz     load_the_file
  620.          int     error
  621.          db      not_found_error,'cannot find file',0
  622.  
  623. ;note no return after writing out error
  624.  
  625. ;file loaded here if present
  626.  
  627. load_the_file:
  628.  
  629. dseg
  630.  
  631. my_file_name:
  632.  
  633.          db      '$.myfile',cr
  634.  
  635. ;end
  636.  
  637. Escape Processing
  638.  
  639. When  an  escape condition is detected by the 65C12, the top bit of the
  640. escape flag at 0000:05F2H on the 80186 is set under interrupt. An escape
  641. condition should be  tested  for  by  checking  this escape flag. If an
  642. escape  condition exists the escape must be acknowledged  using  OSBYTE
  643. with AL=07EH  and an optional 80186 error message can be generated. The
  644. escape flag should  not be set or reset directly as the change will not
  645. be reflected on the  host side of the Tube. OSBYTE calls with AL = 07CH
  646. or 07DH should be used to set or reset the escape condition.
  647.  
  648.  
  649. The 80186 monitor
  650.  
  651. After  enabling  the co-processor and  either  pressing  ESCAPE  before
  652. loading DOS+, or  pressing  BREAK  from within DOS+ you should get the
  653. following displayed on the screen:
  654.  
  655. Acorn Tube 80186 512K
  656.  
  657. Acorn ADFS
  658.  
  659. BASIC
  660.  
  661. *
  662.  
  663. The star (*) prompt indicates that  the  80186 monitor has been entered
  664. and is waiting for commands to send to  the command line interpreter on
  665. the  80186 or the 65C12. In addition to the  standard  MOS  and  filing
  666. system commands, the 80186 recognises the following monitor commands:
  667.  
  668. Name             Function
  669.  
  670. *D               Memory dump in hex and ascii
  671. *DOS             Boot DOS+ from hard disc or floppy
  672. *F               Fill memory with a byte or word
  673. *GO              Jump to a specified address
  674. *MON             Re-enter the monitor
  675. *S               Alter memory using hex or ascii
  676. *SR              Search memory for a specified text string
  677. *TFER            Transfer blocks of memory between 80186 and 65C12
  678.  
  679. Note that  from within the monitor you cannot run 65C12 languages such
  680. as BASIC, but 65C12 utilities such as Advanced Disc Toolkit will work.
  681.  
  682. You cannot use the monitor  from the 80186 under DOS+ by using the STAR
  683. utility, you will in fact find  that  the  monitor  is not resident and
  684. will not appear on the *HELP table from under DOS+.
  685.  
  686. The above commands  are now explained in more detail. Where <offset> is
  687. used it refers to  the  hexadecimal offset address which can be entered
  688. as 1 to 4 digits -  leading  zeros  (0)  can  be omitted i.e. 7A can be
  689. entered as 7A, 07A or 007A. If more than 4 hex  digits  are entered the
  690. most significant digits will be truncated i.e. 12345 will be treated as
  691. 2345.  Where  <segment>  is used it refers to the 80186 segment address
  692. which can also be entered as above, but must be followed immediately by
  693. a colon (:) to indicate that it is a segment address. i.e. 23: .
  694.  
  695. In all relevant commands below  if no segment address is specified then
  696. the most recently specified value will  be  used.  If no previous value
  697. has been specified then the value should be 0.  For  all  commands  any
  698. leading  spaces  or asterisks or trailing spaces will be ignored. Items
  699. enclosed in <>  brackets  indicate  parameters  that  the command uses,
  700. those  that  are  also  enclosed   in  ()  brackets  indicate  optional
  701. parameters that do not need to be specified. None of these commands are
  702. case sensitive, so both upper  and  lower case or a mixture of both may
  703. be used.
  704.  
  705. *D       Memory dump
  706.  
  707. Syntax
  708.  
  709. *D (<segment:>) (<start offset>) (<end offset>)
  710.  
  711. Function
  712.  
  713. This  command  produces a memory dump from the 80186 memory between the
  714. specified  addresses  in  hex  and  ascii,  showing  the  addresses  in
  715. segment:offset form. Characters  outside the ascii range 20H to 7EH are
  716. shown as a full  stop  on  the  ascii list with their corresponding hex
  717. value  in  the hex list. All of the  parameters  in  this  command  are
  718. optional, If the  segment  address  is  omitted  the  last used segment
  719. value will be used. If the start and end  offsets  are omitted the last
  720. end  address  +  010H  is used as the start address and  the  last  end
  721. address + 080H is used  as  the end address, if just the end address is
  722. omitted then the start address + 080H is used.
  723.  
  724. For example:
  725.  
  726. *D 0000:8000 8050
  727.  
  728. 0000:8000 04 48 BA 6D 01 8B F0 05 50 00 3D 64 00 72 03 2D .H.m....P.=d.r.- 
  729. 0000:8010 64 00 50 33 DB B9 0C 00 3B 97 E4 1A 76 05 83 C3 d.P3....;...v... 
  730. 0000:8020 02 E2 F5 D1 EB 53 4B D1 E3 8B C6 8B CF 83 FB 02 .....SK......... 
  731. 0000:8030 75 0F A9 03 00 75 0A D1 E8 D1 E8 40 3B C1 75 01 u....u.....@;.u. 
  732. 0000:8040 42 2B 97 E4 1A 58 8A F0 59 58 C3 BB C2 1A EB 0F B+...X..YX...... 
  733. 0000:8050 80 3E 00 0F 00 74 05 B2 01 E8 7B EE BB B4 1A 8B .>...t....{..... 
  734.  
  735.  
  736.  
  737. *DOS     Re boot DOS+
  738.  
  739. Syntax
  740.  
  741. *DOS
  742.  
  743. Function
  744.  
  745. Allows  DOS  to  be booted without CTRL+BREAK  i.e.  from  stand  alone
  746. languages or applications, or restart DOS after pressing BREAK to leave
  747. DOS. This command will  try  to  boot  DOS  from  a hard disc if one is
  748. present or from floppy.
  749.  
  750. *F       Fill memory with a constant
  751.  
  752. Syntax
  753.  
  754. *F (<segment:>) <start offset> <end offset> <fill byte|word>
  755.  
  756. Function
  757.  
  758. This  command  fills  the 80186 memory within the specified range, with
  759. the specified constant. The constant used can be specified as a byte or
  760. word value. The end offset specified is the end address + 1 used by the
  761. fill command i.e.
  762.  
  763. *F 1000 1010 55
  764.  
  765. Will fill bytes 1000H to 100FH inclusive with the value 55H
  766.  
  767. *F 1000 1010 1234
  768.  
  769. Will fill bytes 1000h  to  100FH inclusive with the word 1234H with the
  770. Lsb written first. i.e. 1000H will  be 34, 1001H will be 12, 1002H will
  771. be 34, etc.
  772.  
  773. An end offset of 0 can be  used to specify a fill operation to the last
  774. address in the specified segment.
  775.  
  776. *GO      Jump to a specified address
  777.  
  778. Syntax
  779.  
  780. *GO (<segment:>) <offset>
  781.  
  782. Function
  783.  
  784. This command calls and transfers control to a  piece  of  code  that is
  785. resident  at the specified address in the 80186. This command should be
  786. used with  care,  as  calling  an  address  which  does not contain any
  787. executable code could cause the machine to hang or crash.
  788.  
  789. *MON     Enter the 80186 monitor
  790.  
  791. Syntax
  792.  
  793. *MON
  794.  
  795. Function
  796.  
  797. Allows the monitor to be  re-entered  from  stand  alone  languages  or
  798. applications without pressing BREAK, or from within other routines.
  799.  
  800.  
  801. *S       Edit memory contents
  802.  
  803. Syntax
  804.  
  805. *S (<segment:>) <start offset>
  806.  
  807. Function
  808.  
  809. This utility allows the memory contents of the 80186 to be examined and
  810. altered  if  required. A line of 16 bytes of memory is displayed in hex
  811. and ascii formats  initially with the cursor positioned under the least
  812. significant digit of the first byte specified.. The cursor movement and
  813. data entry is controlled using the following keys:
  814.   
  815. Cursor left      Move left - If at far left display previous 16 bytes
  816. Cursor right     Move right - If at far right next 16 bytes
  817. Cursor up        Display next 16 bytes
  818. Cursor down      Display previous 16 bytes
  819. Shift+cr left    Move cursor to far left of current field
  820. Shift+cr right   Move cursor to far right of current field
  821. Copy             Toggle between hex and ascii entry
  822.  
  823. The display consists of  two  16  byte fields which are the hex display
  824. and the ascii display. The copy key is used to switch between the two.
  825.  
  826. For example:
  827.  
  828. *S 0040
  829.  
  830. SEG :OFFS        HEX FIELD                                       ASCII FIELD 
  831.  
  832. 0000:0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................  
  833. 0000:0030 D6 1F 00 F0 00 00 00 00 00 00 00 00 00 00 00 00 ................  
  834. 0000:0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................  
  835. 0000:0010 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 ................  
  836. 0000:0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................  
  837. 0000:0030 D6 1F 00 F0 00 00 00 00 00 00 00 00 00 00 00 00 ................  
  838.  
  839. While the cursor is in the hex  field  data  is  entered in hex digits,
  840. each digit being shifted in from the right as they are entered, i.e. to
  841. enter 23 you would move to the hex entry for the  required  address and
  842. type in the number  2  giving 02 then 3 which would cause the 2 to move
  843. left giving 23. If you now  enter 4 then the 3 will move left replacing
  844. the 2 and the 4 will be entered giving 34.
  845.  
  846. If the cursor is in the ASCII field data is entered as ASCII bytes i.e.
  847. characters from the keyboard, including control characters (CTRL+char).
  848. To advance the cursor to the next byte, the cursor keys are used in the
  849. hex field, but it is done automatically  in  the ASCII field. When text
  850. is entered into the last field on the right,  the cursor is advanced to
  851. the first field of the next 16 bytes.
  852.  
  853. This command is terminated by pressing ESCAPE
  854.  
  855. *SR      Search memory for a text string
  856.  
  857. Syntax
  858.  
  859. *SR (<segment:>) <start offset> <end offset> <"string">
  860.  
  861. Function
  862.  
  863. Search  memory for a specified text string reporting all occurrences in
  864. the segment:offset form. i.e.
  865.  
  866. *SR 0000 0200 "AAAA33"
  867. 0000:0040
  868. 0000:00C6
  869. 0000:011C
  870. *
  871.  
  872. The address  given  is  of  the  first byte of the matching string. The
  873. search string must be enclosed in double  quotes (") and can be upto 72
  874. characters  in  length  (the maximum length of a  command  line  is  80
  875. characters). The end offset  specified  is  the  end  address +1 of the
  876. search area, so to allow the search to continue  right up to the end of
  877. a segment an end address of 0 can be specified i.e.
  878.  
  879.  
  880. *SR 4000 0 "fred"
  881.  
  882. This will search from 4000H up to FFFFH inclusive. The  condition for a
  883. string to be found is that it must be completely contained  within  the
  884. search area, i.e. if the string "fred" lives at 03FFDH then
  885.  
  886. *SR 0 4000 "fred"
  887.  
  888. Will  not  report  it but if our string "fred" lives at 03FFCH then the
  889. above search will find  it.  Any 8 bit character string can be searched
  890. for using escape sequences to allow  control codes and characters above
  891. 07FH to be specified. The | character  is  used  to  denote  an  escape
  892. sequence. i.e. |@ is ascii 0 and |G is ascii 7.  |?  is  ascii  7F  and
  893. characters over 80H as preceded by |!.
  894.  
  895. Any  escape  sequences  that  are  not  recognised  are  reduced to the
  896. argument alone, i.e. "|1" is reduced to "1". Any  surplus  |! operators
  897. are ignored, i.e. "|!|!|@" is reduced to "|!|@".
  898.  
  899. *TFER    Transfer blocks of memory between 80186 and 65C12
  900.  
  901. Syntax
  902.  
  903. *TFER <I/O address> (<segment:>) <offset> <length> <R/W>
  904.  
  905. Function
  906.  
  907. This utility allows fast block transfer of memory between the 80186 co-
  908. processor and the 65C12 host  processor.  The  direction of transfer is
  909. specified by the final parameter which must be R (read) or W (write). W
  910. indicates a write to 65C12 memory from 80186 memory. R indicates a read
  911. from 65C12 memory to 80186  memory.  The  transfer is implemented using
  912. OSWORD  0FAH (described below) and is optimised to  use  fast  transfer
  913. types 6 and 7 (10us/byte) where possible. If the transfer length is not
  914. a multiple  of 256 (FFH) bytes any remaining bytes are transferred using
  915. types 0 and 1 (24us/byte).
  916.  
  917. References
  918.  
  919. Detailed  technical  information on the 80186, including the extensions
  920. to the instruction  set  over the 8086 can be found in the 80186 or the
  921. 80C186 data sheet which is available from Intel.
  922.  
  923. A large amount of technical  information on the Master 512 can be found
  924. in the Dab Hand Reference Guide to the Master 512, by Robin Burton.
  925.  
  926. Technical  documents  are  available  on  the Tube interface and how it
  927. works. These are available from The Acorn Customer services dept.
  928.  
  929. DABS PRESS, 76 GARDNER RD, PRESTWICH, MANCHESTER
  930. GLENTOP PUBLISHERS LTD, STANDFAST HOUSE, BATH PLACE, BARNET, HERTS, EN5 5XE 
  931. DIGITAL RESEARCH, OXFORD HOUSE, OXFORD STREET, NEWBURY, BERKS, RG13 1JB
  932. INTEL UK LTD, PIPERS WAY, SWINDON WILTS, SN3 1RJ
  933.  
  934. FOR REPAIRS
  935.  
  936. RCS, Headway House, Christy Estate, Ivy Rd, Aldershot, Hants, GU12 4TX. Tel: 0252 333575 
  937. Eltec Services, Campus Rd, Listerhills Science Park, Bradford, BD7 1HR. Tel: 0274 722512 
  938. Gosling Electronics, Hadleigh Rd, Ipswich, IP2 0ER. Tel: 0473 230075
  939.  
  940. FOR SPARES
  941.  
  942. DRAM ELECTRONICS LTD, UNIT 12, KINGSTON MILL, CHESTERGATE, STOCKPORT, SK3 0AL 
  943.  
  944.  
  945.  
  946.  
  947. THIS    INFORMATION   IS  SUBJECT  TO   CHANGE   WITHOUT   NOTICE.   NO
  948. RESPONSIBILITY  CAN BE TAKEN FOR  ANY  ERRORS  OR  OMISSIONS  CONTAINED
  949. WITHIN THIS  DOCUMENT, OR THE APPLICATIONS DESCRIBED. THE MASTER 512 IS
  950. NOT AN IBM  PC  CLONE  SO  NO  RESPONSIBILITY  CAN  BE  TAKEN  FOR  ANY
  951. APPLICATIONS  WHICH  DO  NOT  WORK  IN  ACCORDANCE WITH THEIR PUBLISHED
  952. INSTRUCTIONS.
  953.  
  954. DOS+  and  GEM are trade marks of Digital Research. Acorn, Tube, Master
  955. 128 and Master 512 are  trade  marks of Acorn Computers Ltd. 80186 is a
  956. trade mark of Intel inc.
  957.